#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

set<string> words;
bool check(const string& word) {
  int len = word.size();
  rep(i, 1, len - 1) {
    string x = word.substr(0, i);
    string y = word.substr(i);
    if (words.count(x) && words.count(y)) return true;
  }
  return false;
}
void solve() {
  for (string word : words)
    if (check(word)) cout << word << endl;
}

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  string w;
  while (cin >> w) words.insert(w);
  solve();
  return 0;
}